import quantlib
seed = 42
sampleSize = 100000
rng = quantlib.GPUMersenneTwisterCreatedOnDevice(sampleSize,seed)
args = quantlib.StringFloatMap()
args["vol"] = 0.3
args["rate"] = 0.06
args["paymentTimeInYears"] = 1.0
args["strike"] = 40.0
args["initial"] = 44.0
pg = quantlib.GBMSingleCallOptionGPUPrePathGenerator(sampleSize, rng, args)
##res = pg.generate()
theEngine = quantlib.GPUMCEngine(pg)
theInstrument = quantlib.GPUInstrument()
theInstrument.setPricingEngine(theEngine)
res = theInstrument.NPV()
print(res)